import unittest
import time
from fuzzywuzzy import fuzz

from pb.comfuc import Comfuc


class MyTestCase(unittest.TestCase):
    def test1(self):

        print('1740155400000')
        print(time.time())

    def test2(self):
        aa = Comfuc.invert_sign(0.0)
        print(aa)

    def test3(self):
        aa = Comfuc.sign(3.5)
        print(aa)

    def test4(self):
        random_letters = Comfuc.generate_random_letters()
        print(random_letters)



    def test_something(self):
        # 示例字符串
        num_str = "42"

        # 转换为浮点数
        num_float = float(num_str)

        print(num_float)  # 输出: 42.0
        # 示例字符串
        num_str = "0.75"

        # 转换为浮点数
        num_float = float(num_str)

        print(num_float)  # 输出: 42.0

    def test_xsd(self):
        # 示例球队名称
        t1=time.time()
        team1 = "MartiguesVSAnnecy"
        team2 = "FC MartiguesVSAnnecy FC"

        # 计算相似度
        similarity = fuzz.ratio(team1, team2)
        t2 = time.time()
        print(similarity)
        print(t2-t1)

if __name__ == '__main__':
    unittest.main()
